import { createApp } from 'vue'
import './style.css'
import App from './App.vue'
import router from '@/router'
import ElementPlus, { ElMessageBox, ElMessage} from 'element-plus'
import 'element-plus/dist/index.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import Request from '@/utils/Request'

// 组件
import BlogItem from '@/components/BlogItem.vue'
import CategoryItem from '@/components/CategoryItem.vue'
import UserItem from '@/components/UserItem.vue'
import SpecialItem from '@/components/SpecialItem.vue'

const app = createApp(App)

app.use(router)
app.use(ElementPlus)
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}
app.config.globalProperties.Request = Request
app.config.globalProperties.$message = ElMessage
app.config.globalProperties.$messageBox = ElMessageBox
app.config.globalProperties.imageUrl = "/api/file/getImage/"

app.component("BlogItem", BlogItem)
app.component("CategoryItem", CategoryItem)
app.component("UserItem", UserItem)
app.component("SpecialItem", SpecialItem)

app.mount('#app')
